IMGLYBackgroundRemover

ONNX Runtime based background remover that uses IMG.LY segmentation models.

Parameters

config

IMG.LY background removal configuration.

Constructors

Link copied to clipboard
constructor(config: IMGLYBackgroundRemovalConfig)

Functions

Link copied to clipboard
suspend fun forceDownloadModel(context: Context)

Forces model file download outside editor scope. This can be helpful if you want to have the model ready even before the editor is launched.

Link copied to clipboard
open override fun EditorScope.initialize()

Starts loading the configured model when IMGLYBackgroundRemovalConfig.loadMode is eager.

Link copied to clipboard
open suspend override fun EditorScope.processImage(bitmap: Bitmap): BackgroundRemovalMask

Runs the configured ONNX model for bitmap and returns its foreground mask.